package com.atwisdom.star.interceptors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class WebAppConfigur implements WebMvcConfigurer {
    @Autowired
    AuthorityInterceptor authorityInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //String[] patterns = new String[] {"/*.html","**/akVehicleInfo/**","**/akReport/**","**/akReChart/**"};
        //添加拦截及url通配
        registry.addInterceptor(authorityInterceptor)
                .addPathPatterns("/consume/**")
                .addPathPatterns("/resource/**")
                .addPathPatterns("/equipPoint/**")
                .addPathPatterns("/specification/**")
                .addPathPatterns("/auth/**")
                .addPathPatterns("/infConfig/**")
                .excludePathPatterns("/resourceTenant/**")
                .excludePathPatterns("//scheduleTask/**")
                .excludePathPatterns("/auth/**/menuByUserId/**")
                .excludePathPatterns("/auth/**/login/**");
    }
}
